package team.knowers.tourist.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import team.knowers.tourist.common.convention.result.Result;
import team.knowers.tourist.common.convention.result.Results;
import team.knowers.tourist.dao.entity.NoticeDO;
import team.knowers.tourist.service.NoticeService;

import java.util.List;

@RestController
@RequiredArgsConstructor
public class NoticeController {
    private final NoticeService noticeService;

    //各用户查看通知
    @GetMapping("/api/tourist/getNoticesPerTourist")
    public Result<List<NoticeDO>> getNoticesPerTourist(int touristId) {
        return Results.success(noticeService.getNoticesPerPeople(touristId));
    }
}
